﻿using System;
using System.Collections.Generic;
using System.IO;
using SimpleFS.Core;
using SimpleFS.Core.Implementations;

namespace SimpleFS.Services.Journaling
{
    public class File : AbstractFile
    {
        protected IJournalingServiceProvider proivder;

        public File(IFile internalObject, IJournalingServiceProvider provider)
            : base(internalObject)
        {
            this.proivder = provider;
        }

        public override Stream Read()
        {
            this.proivder.Write(string.Format("Read File: {0}", this.internalObject.Name));
            return base.Read();
        }

        public override void Write(Stream stream)
        {
            this.proivder.Write(string.Format("Write File: {0}", this.internalObject.Name));
            base.Write(stream);
        }
    }
}
